//
//  myButton.m
//  A段项目音乐播放
//
//  Created by 太阳 on 15/5/23.
//  Copyright (c) 2015年 lanou3g.com蓝鸥科技. All rights reserved.
//

#import "myButton.h"
#import "SingerModel.h"
#import "SingerState.h"
#import "playViewController.h"
@implementation myButton

- (void)dealloc
{
    [super dealloc];
}

//- (myButton *)addTarget:(id)delegate
//{
//    [self addTarget:delegate action:@selector(buttonaction) forControlEvents:UIControlEventTouchUpInside];
//}
//- (void)buttonaction
//{
//    
//}

- (void)addButtonAction:(id)target
{
    [self addTarget:target action:@selector(buttonaction) forControlEvents:UIControlEventTouchUpInside];
}

- (void)buttonaction
{
    SingerState *singer = [SingerState shareOfPlayState];
    SingerModel *model = [singer.playListAddress objectAtIndex:self.row];
    singer.addNum ++;  //添加数量
    
    [singer.playListAddress insertObject:model atIndex:singer.num + singer.addNum];
    playViewController *play = [[[playViewController alloc]init] autorelease];
    [play.songListTableview reloadData];
    
    
    NSLog(@"插入%@", model.name);
}

@end
